package com.gin.no_gay_alliance.adpter.forum;

import android.content.Context;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;

import com.gin.no_gay_alliance.adpter.base.BaseBindingRecyclerViewAdapter;
import com.gin.no_gay_alliance.databinding.ItemForumEntryBinding;
import com.gin.no_gay_alliance.viewmodel.EntryData;

import java.util.List;

/**
 * 版面入口适配器
 *
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/8/31 14:58
 **/
public class ForumEntryAdapter extends BaseBindingRecyclerViewAdapter<ItemForumEntryBinding, EntryData> {
    int position = 1;
    int size = 64;

    public ForumEntryAdapter(Context context) {
        super(context);
    }

    public ForumEntryAdapter(@NonNull Context context, @NonNull List<EntryData> data) {
        super(context, data);
    }

    @Override
    protected void onBindViewHolder(ViewHolder<ItemForumEntryBinding> holder, @NonNull ItemForumEntryBinding b, int position, EntryData item) {
        b.getRoot().init(item, this.position, this.size);
    }

    @NonNull
    @Override
    protected ItemForumEntryBinding buildBinding(LayoutInflater inflater) {
        return ItemForumEntryBinding.inflate(inflater);
    }

    @Override
    protected boolean useZebraStripe() {
        return false;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public void setSize(int size) {
        this.size = size;
    }
}
